#!/bin/sh

if [ "$(uci -q get upnpd.config.external_ifac)" != "omrvpn" ]; then
	uci -q batch <<-EOF >/dev/null
		set upnpd.config.external_iface=omrvpn
		commit upnpd
	EOF
fi

if [ "$(uci -q get upnpd.@perm_rule[0].ext_ports)" = "1024-65535" ]; then
	uci -q batch <<-EOF >/dev/null
		set upnpd.@perm_rule[0].ext_ports='1024-64999'
		commit upnpd
	EOF
fi

exit 0
